import sys

sys.set_int_max_str_digits(10000000)

def A(n, m):
    res = 1
    for i in range(1, 1 + n):
        res *= i
    for i in range(1, 1 + n - m):
        res //= i
    return res

n, m = map(int, input().split())
ans = 0
if n + 3 >= m:
    ans = A(n + 3, m) * A(n + 2, n + 2)
if n + 2>= m:
    ans -= 2 * A(n + 2, m) * A(n + 1, n + 1)

print(ans)